package com.codecrane.core.util;

/**
 * Created by 752322896 on 2019/4/8.
 */
public enum CountryEnum {
    US(1, "US"),
    UK(2, "UK"),
    DE(3, "DE"),
    FR(4, "FR"),
    IT(5, "IT"),
    ES(6, "ES"),
    EU(7, "EU"),
    JP(8, "JP"),
    CA(9, "CA"),
    CN(10, "CN"),
    PKUS(13,"PK-US"),
    PKUK(14,"PK-UK"),
    PKDE(15,"PK-DE");

    private int code;
    private String msg;

    CountryEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    /**
     * 根据充值类型获取充值的天数
     */
    public static String getCountry(int code) {
        for (CountryEnum countryEnum : CountryEnum.values()) {
            if (code == countryEnum.getCode()) {
                return countryEnum.getMsg();
            }
        }
        return "";
    }
}
